﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Drawing;
using System.Text;

namespace TrafficApp
{
    public abstract class TrafficLight
    {

        public enum colour
        {
            Red,
            Yellow,
            Green
        }

        /// <summary>
        /// size of the trafficlight
        /// </summary>
        public int size;

        /// <summary>
        /// the color of the trafficlight
        /// </summary>
        protected Color clr;
        public Color Clr
        {
            get
            {
                return clr;
            }
        }

        public bool horizon = false;

        /// <summary>
        /// circle (light)
        /// </summary>
        public Rectangle light;

        /// <summary>
        /// location
        /// </summary>
        public Vector[] Loc = new Vector[3];
      
        /// <summary>
        /// constructor
        /// </summary>
        protected TrafficLight(Vector Location, int Size, bool horizontal)
        {
            horizon = horizontal;
            Loc[0] = Location;
            LocChanger(horizontal);
            size = Size;
            light = new Rectangle((int)Loc[0].X, (int)Loc[0].Y, size, size);
            //TLState = colour.Red;
            clr = Color.Red;
        }
        public virtual void ChangeColor(colour state)
        {
        }

        public void LocChanger(bool horizontal)
        {
            if (!horizontal)
            {
                Loc[1] = new Vector(Loc[0].X, Loc[0].Y + 6);
                Loc[2] = new Vector(Loc[0].X, Loc[0].Y + 12);
            }
            else
            {
                Loc[1] = new Vector(Loc[0].X + 6, Loc[0].Y);
                Loc[2] = new Vector(Loc[0].X + 12, Loc[0].Y);
            }
        }
    }
}
